package com.marquis.cloud.utils;

import java.util.Properties;

/**
 * 配置文件属性获取
 */
public class PropertiesUtil {

    /**
     * 获取属性
     * @return
     */
    public Properties getProperies(){
        Properties prop = new Properties();
        try {
            prop.load(this.getClass().getResourceAsStream("/resource.properties"));
        } catch (Exception e) {
            e.printStackTrace();
        }
        return prop;
    }

    /**
     * 获取网关地址
     * @return
     */
    public String getZuulUrl(){
        PropertiesUtil propertiesUtil = new PropertiesUtil();
        Properties pu = propertiesUtil.getProperies();
        String ip = pu.getProperty("zuul.ip");
        String port = pu.getProperty("zuul.port");
        return "http://"+ip+":"+port;
    }
}
